package com.htudata.zabbix.api.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HistoryZabbixApiService {

  @Autowired
  private BaseZabbixApiService baseZabbixApiService;

  public String getHistory(JSONObject params) throws Exception {
    JSONObject request = new JSONObject();
    request.put("jsonrpc", "2.0");
    request.put("method", "history.get");
    request.put("params", params);
    request.put("id", Integer.valueOf(0));
    return this.baseZabbixApiService.getJSONResult(request);
  }
}
